<script setup lang="ts">
import { ref } from 'vue';
const activeIds = ref([1, 2]);
const activeIndex = ref(0);
const items = [
    {
        text: '浙江',
        children: [
            { text: '杭州', id: 1 },
            { text: '温州', id: 2 },
            { text: '宁波', id: 3, disabled: true },
        ],
    },
    {
        text: '江苏',
        children: [
            { text: '南京', id: 4 },
            { text: '无锡', id: 5 },
            { text: '徐州', id: 6 },
        ],
    },
    { text: '福建', disabled: true },
];
const click_item = ()=>{
    console.log(activeIds.value);
    console.log(activeIndex.value);
}
</script>

<template>
    <van-tree-select v-model:active-id="activeIds" v-model:main-active-index="activeIndex" :items="items" @click-item="click_item"/>
</template>

<style></style>